LanguageExt.Core

LanguageExt.Core TypeClasses Num

Contents

interface Num <A> Source #

Numerical value type-class

Parameters

type A

The type for which the number operations are defined.

class TypeClass Source #

Methods

method A plus <NUM, A> (A x, A y) Source #

where NUM : struct, Num<A>

Find the sum of two numbers

Parameters

param x

left hand side of the addition operation

param y

right hand side of the addition operation

returns

The sum of x and y

method A subtract <NUM, A> (A x, A y) Source #

where NUM : struct, Num<A>

Find the subtract between two numbers

Parameters

param x

left hand side of the subtraction operation

param y

right hand side of the subtraction operation

returns

The sum subtract between x and y

method A product <NUM, A> (A x, A y) Source #

where NUM : struct, Num<A>

Find the product of two numbers

Parameters

param x

left hand side of the product operation

param y

right hand side of the product operation

returns

The product of x and y

method A divide <NUM, A> (A x, A y) Source #

where NUM : struct, Num<A>

Divide two numbers

Parameters

param x

left hand side of the division operation

param y

right hand side of the division operation

returns

x / y

method A negate <NUM, A> (A x) Source #

where NUM : struct, Num<A>

Negate the value

Parameters

param x

Value to negate

returns

The negated source value

method A abs <NUM, A> (A x) Source #

where NUM : struct, Num<A>

Find the absolute value of a number

Parameters

param x

The value to find the absolute value of

returns

The non-negative absolute value of x

method A signum <NUM, A> (A x) Source #

where NUM : struct, Num<A>

Find the sign of x

Parameters

param x

The value to find the sign of

returns

-1, 0, or +1

method A fromInteger <NUM, A> (int x) Source #

where NUM : struct, Num<A>

Generate a numeric value from an integer

Parameters

param x

The integer to use

returns

The equivalent of x in the Num

method A fromDecimal <NUM, A> (decimal x) Source #

where NUM : struct, Num<A>

Generate a numeric value from a float

Parameters

param x

The float to use

returns

The equivalent of x in the Num

method A fromFloat <NUM, A> (float x) Source #

where NUM : struct, Num<A>

Generate a numeric value from a double

Parameters

param x

The double to use

returns

The equivalent of x in the Num

method A fromDouble <NUM, A> (double x) Source #

where NUM : struct, Num<A>

Generate a numeric value from a decimal

Parameters

param x

The decimal to use

returns

The equivalent of x in the Num